package com.gujiangbo.chapter05;

/**
 * @Author: gujiangbo.co
 * @Contact: 646832012@qq.com
 * @Date: 2022/3/25 20:45
 * @Version: 1.0
 * @Description:
 */
public class StackFrameTest {

    public static void main(String[] args) {
        StackFrameTest stackFrameTest = new StackFrameTest();
        stackFrameTest.method1();
        System.out.println(accumulated(12, 34));
    }

    public void method1() {
        System.out.println("=====method1 开始执行========");
        method2();
        System.out.println("=====method1 执行结束========");
    }

    private void method2() {
        System.out.println("=====method2 开始执行========");
        method3();
        System.out.println("=====method2 执行结束========");
    }

    private void method3() {
        System.out.println("=====method3 开始执行========");
        System.out.println("=====method3 执行结束========");
    }

    public static int accumulated(int i, int j) {
        int a = Integer.MAX_VALUE;
        int b = Integer.MIN_VALUE;
        return i + j + a + b;
    }

    public void localVar() {
        {
            int a = 0;
            System.out.println(a);
        }
        int b = 2;
    }

    public void operaStack() {
        byte i = 15;
        int j = 8;
        int k = i + j;
    }
}
